#include "label.h"

//标签-方块
GLabel::GLabel(QWidget* parent) : QLabel(parent)
{
    this->type = 7;
    int size = parent->width()/20 < parent->height()/20? parent->width()/20 : parent->height()/20;
    this->setMinimumSize(size,size);
    this->setMaximumSize(size,size);
    this->setStyleSheet("border:1px solid rgb(255,255,255);background-color: rgb(0,0,0);");
}

void GLabel::getGLabelcolor(char* color)
{
    switch(this->type)
    {
        case 0:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(255,0,0)");
                    break;
        case 1:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(0,0,255)");
                    break;
        case 2:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(0,255,0)");
                    break;
        case 3:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(255,0,0)");
                    break;
        case 4:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(0,0,255)");
                    break;
        case 5:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(0,255,0)");
                    break;
        case 6:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(255,0,0)");
                    break;
        case 7:     sprintf(color,"border:1px solid rgb(255,255,255);background-color: rgb(0,0,0)");
                    break;
        default :   break;
    }
}

GLabel::~GLabel(){}

//标签-记分
SLabel::SLabel(QWidget* parent) : QLabel(parent)
{
    this->setMinimumSize(LabelW,LabelH);
    this->setMaximumSize(LabelW,LabelH);
    this->setStyleSheet("border:5px solid rgb(255,0,0);background-color: rgb(255,255,255);");

    QFont font;
    font.setPointSize(16);
    this->setFont(font);
    this->setAlignment(Qt::AlignCenter);
}

SLabel::~SLabel(){}

//标签-标题
TLabel::TLabel(int x,QWidget* parent) : QLabel(parent)
{
    this->setMinimumSize(LabelW,LabelH);
    this->setMaximumSize(LabelW,LabelH);
    this->setStyleSheet("border:5px solid rgb(0,0,0);");
    if(0 == x)
        this->setText("得分");
    else
        this->setText("最高分");

    QFont font;
    font.setPointSize(15);
    this->setFont(font);
    this->setAlignment(Qt::AlignCenter);
}

TLabel::~TLabel(){}
